﻿using System.Collections.Generic;
using Microsoft.Practices.SharePoint.Common.Logging;
using Microsoft.SharePoint.Administration;

namespace SharePoint.Contrib.Extensions
{
    /// <summary>
    /// Extensions for the DiagnosticsAreaCollection class
    /// </summary>
    internal static class DiagnosticsAreaCollectionExtensions
    {
        public static IEnumerable<SPDiagnosticsArea> AsSPDiagnosticsAreas(this DiagnosticsAreaCollection instance)
        {
            foreach (var area in instance)
            {
                yield return area.ToSPDiagnosticsArea();
            }
        }
    }
}
